<template>
	<view>
		<view class="YouRan-UI-LieBiao-7">
			<template v-if="BenYe_ShuJu_ZhuangTai=='You_ShuJu'">
				<view
					@click="$_TiaoZhuan('_XiangQing_TieZi/_XiangQing_TieZi?pid='+item.pid)"
					class="XunHuan Flex" v-for="item in BenYe_LieBiao">
					<view class="Zuo Bj-BeiJingSe Flex">
						<view>{{item.commentCount}}</view>
						<view>回复</view>
					</view>
					<view class="Zhong Flex">
						<view>{{item.likeCount}}</view>
						<view>点赞</view>
					</view>
					<view class="You Flex">
						<view class="H2-Line YiHang">
							{{item.title?item.title:$_GuoLv_HTML(item.content)}}
						</view>
						<view class="XinXi Flex">
							<view class="YongHu Flex">
								<view><image :src="item.creator.avatar" mode="widthFix"></image></view>
								<text>{{item.creator.nickname}}</text>
							</view>
							<view class="ShiJian">{{item.createTimeFormat}}</view>
							<view class="LanMu" v-if="item.group"># {{item.group.gname}}</view>
						</view>
					</view>
				</view>
				<view
					@click="DianJi_JiaZai_GengDuo"
					class="H3 H3-Line Bj-BeiJingSe Zt-ZhanWeiSe Flex"
					style="padding: 35rpx 0;text-align: center;margin: 25rpx;justify-content: center;border-radius: 100rpx;">点击加载更多</view>
			</template>
			<template v-if="BenYe_ShuJu_ZhuangTai=='JiaZaiZhong'">
				<YouRan-UI-JiaZaiZhong LeiXing="JuBu"></YouRan-UI-JiaZaiZhong>
			</template>
			<template v-if="BenYe_ShuJu_ZhuangTai=='Wu_ShuJu'">
				<view class="YouRan-UI-WuShuJu-1 Flex" style="padding: 50rpx 0;">
					<text class="iconfont icon-cry Zt-ZhanWeiSe"></text>
					<view class="Zt-ZhanWeiSe">暂无任何数据</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				BenYe_LieBiao:[],
				BenYe_ShuJu_ZhuangTai:"JiaZaiZhong",
				BenYe_ChuShiHua_YeMa:2
			}
		},
		onLoad() {
			this.QingQiu()
		},
		methods: {
			QingQiu(){
				uni.request({
					url:this.$_URL() + "/api/v2/post/list",
					method:'GET',
					header:this.$_Fresns_Header(),
					data:{
						"uidOrUsername":uni.getStorageSync('YongHuXinXi').data.detail.username
					},
					success: (res) => {
						if(res.data.code == 0){
							this.BenYe_LieBiao = res.data.data.list;
							if(this.BenYe_LieBiao.length){
								this.BenYe_ShuJu_ZhuangTai = 'You_ShuJu';
							}else{
								this.BenYe_ShuJu_ZhuangTai = 'Wu_ShuJu';
							}
						}else{
							uni.showToast({
								title:res.data.message,
								icon:"none",
								duration:1000
							});
							setTimeout(()=>{
								uni.navigateBack()
							},1000);
						}
					}
				})
			},
			DianJi_JiaZai_GengDuo(){
				uni.showLoading({ title: "加载中" });
				uni.request({
					url:this.$_URL() + "/api/v2/post/list",
					method:'GET',
					header:this.$_Fresns_Header(),
					data:{
						"uidOrUsername":uni.getStorageSync('YongHuXinXi').data.detail.username,
						"page":this.BenYe_ChuShiHua_YeMa
					},
					success: (res) => {
						if(res.data.data.list.length){
							this.BenYe_LieBiao = this.BenYe_LieBiao.concat(res.data.data.list)
							this.BenYe_ChuShiHua_YeMa++
							uni.hideLoading();
						}else{
							uni.hideLoading();
							uni.showToast({
								title: "没有数据啦",
								icon: "none",
								duration: 1000
							});
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
</style>